# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=gnome-builder
pkgver=3.30.1
pkgrel=1
pkgdesc="An IDE for writing GNOME-based software"
url="https://wiki.gnome.org/Apps/Builder"
arch=(x86_64)
license=(GPL3)
depends=(gtksourceview4 devhelp libgit2-glib gjs python-gobject clang desktop-file-utils
         ctags libpeas vte3 vala python-jedi autoconf-archive sysprof flatpak gspell libdazzle
         template-glib jsonrpc-glib python-sphinx webkit2gtk)
makedepends=(intltool llvm gobject-introspection gtk-doc yelp-tools appstream-glib vala git
             mm-common meson)
checkdepends=(xorg-server-xvfb)
optdepends=('gnome-code-assistance: Legacy assistance services')
groups=(gnome-extra)
_commit=13aeec93c878f0d48794fd5eac77298efada155c  # tags/3.30.1^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-builder.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^GNOME_BUILDER_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  git cherry-pick -n ba4d103
}

build() {
  arch-meson $pkgname build \
    --buildtype debugoptimized \
    -D with_docs=true \
    -D with_help=true \
    -D with_editorconfig=true \
    -D with_webkit=true \
    -D with_vapi=true
  ninja -C build
}

check() {
  # some tests need an installed gnome-builder
  xvfb-run meson test -C build || :
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}

# vim:set sw=2 et:
